package com.free.utils.enums;

public enum ENUM_DEVICE_TYPE {

    ANDROID_APP(1,"安卓APP"),
    ANDROID_WAP(2,"安卓触屏"),
    IOS_APP(3,"苹果APP"),
    IOS_WAP(4,"苹果触屏"),
    PC(5, "PC"),
    WECHAT(6, "微信");

    int key;
    String name;

    ENUM_DEVICE_TYPE(int key, String name)
    {
        this.key = key;
        this.name = name;
    }

    public  static ENUM_DEVICE_TYPE getByKey(Integer key)
    {
        for(ENUM_DEVICE_TYPE enst : ENUM_DEVICE_TYPE.values())
        {
            if(enst.getKey() == key){
                return enst;
            }
        }
        return null;
    }

    public boolean isEqual(Integer key)
    {
        return this.key == key;
    }

    public int getKey()
    {
        return key;
    }

    public void setKey(int key)
    {
        this.key = key;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

}
